import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'Home',
        component: () => import('../components/Home/HomePage.vue'),
        meta: {
            title: '首页',
            child: false,
            icon: 'home'
        },
        children: []
    },
    {
        path: '/serial',
        name: 'serial',
        meta: {
            title: '串口助手',
            child: false,
            icon: 'serial'
        },
        children: [
            {
                path: '/serial/text',
                name: 'text',
                component: () => import('../components/Serial/TextPage.vue'),
                meta: {
                    title: '文本模式',
                    child: true,
                    icon: 'text'
                }
            },
            {
                path: '/serial/curve',
                name: 'curve',
                component: () => import('../components/Serial/CurvePage.vue'),
                meta: {
                    title: '曲线模式',
                    child: true,
                    icon: 'curve'
                }
            }
        ]
    },
    {
        path: '/network',
        name: 'network',
        meta: {
            title: '网络助手',
            child: false,
            icon: 'network'
        },
        children: [
            {
                path: '/network/tcp-server',
                name: 'tcp-server',
                component: () => import('../components/Network/TcpServer.vue'),
                meta: {
                    title: 'TCP服务器',
                    child: true,
                    icon: 'server'
                }
            },
            {
                path: '/network/tcp-client',
                name: 'tcp-client',
                component: () => import('../components/Network/TcpClient.vue'),
                meta: {
                    title: 'TCP客户端',
                    child: true,
                    icon: 'client'
                }
            }, {
                path: '/network/udp',
                name: 'udp',
                component: () => import('../components/Network/Udp.vue'),
                meta: {
                    title: 'UDP',
                    child: true,
                    icon: 'udp'
                }
            }
        ]
    },
    {
        path: '/bill',
        name: 'bill',
        meta: {
            title: '账单管理',
            child: false,
            icon: 'bill'
        },
        children: [{
            path: '/bill/record',
            name: 'record',
            component: () => import('../components/Bill/BillRecordPage.vue'),
            meta: {
                title: '账单记录',
                child: true,
                icon: 'record'
            }
        }, {
            path: '/bill/view',
            name: 'view',
            component: () => import('../components/Bill/BillViewPage.vue'),
            meta: {
                title: '账单概览',
                child: true,
                icon: 'view'
            }
        }, {
            path: '/bill/income',
            name: 'income',
            component: () => import('../components/Bill/BillIncomePage.vue'),
            meta: {
                title: '账单收入',
                child: true,
                icon: 'income'
            }
        }, {
            path: '/bill/outcome',
            name: 'outcome',
            component: () => import('../components/Bill/BillOutcomePage.vue'),
            meta: {
                title: '账单支出',
                child: true,
                icon: 'outcome'
            }
        }
        ]
    },
    {
        path: '/game',
        name: 'game',
        meta: {
            title: '游戏娱乐',
            child: false,
            icon: 'game'
        },
        children: [
            {
                path: '/game/snake',
                name: 'snake',
                component: () => import('../components/Game/SnakePage.vue'),
                meta: {
                    title: '贪吃蛇',
                    child: true,
                    icon: 'snake'
                }
            },
            {
                path: '/game/minesweeper',
                name: 'minesweeper',
                component: () => import('../components/Game/minesweeper.vue'),
                meta: {
                    title: '扫雷',
                    child: true,
                    icon: 'minesweeper'
                }
            },
            {
                path: '/game/2048',
                name: '2048',
                component: () => import('../components/Game/2048.vue'),
                meta: {
                    title: '2048',
                    child: true,
                    icon: '2048'
                }
            },
        ]
    },
    {
        path: '/music',
        name: 'music',
        component: () => import('../components/Music/MusicPage.vue'),
        meta: {
            title: '在线音乐',
            child: false,
            icon: 'music'
        },
        children: []
    },
    {
        path: '/video',
        name: 'video',
        component: () => import('../components/Video/VideoPage.vue'),
        meta: {
            title: '在线影视',
            child: false,
            icon: 'video'
        },
        children: []
    },
    {
        path: '/notebook',
        name: 'notebook',
        component: () => import('../components/Notebook/NotePage.vue'),
        meta: {
            title: '文档笔记',
            child: false,
            icon: 'notebook'
        },
        children: []
    },
    {
        path: '/about',
        name: 'about',
        component: () => import('../components/About/AboutPage.vue'),
        meta: {
            title: '关于我们',
            child: false,
            icon: 'about'
        },
        children: []
    },
]
const router = createRouter({
    history: createWebHistory(),
    routes
})
export default router